<?php $this->load->view('layout/header'); ?>

<div class="container_10" id="center_wrapper">

    <div class="grid_10" id="center_wrapper">

        <div class="section_wrapper">

            <h3 class="title_black"><?php echo __('edit_ticket'); ?></h3>
            <!--            Messages-->
            <?php echo isset($messages) ? $messages : NULL; ?>
            <!--            /Messages-->
            <div class="content toggle">

                <div id="tabs">
                    <!--tab link-->
                    <ul>
                        <li><a href="#tab_general"><?php echo __('general'); ?></a></li>
                        <li><a href="#tab_image"><?php echo __('image'); ?></a></li>
                        <li><a href="#tab_advanced"><?php echo __('advanced'); ?></a></li>
                    </ul>
                    <!--/tab link-->

                    <?php
                    echo form_open_multipart('ticket-admin/edit');
                    if (isset($ticket_id) && !is_null($ticket_id))
                        echo form_hidden('ticket_id', $ticket_id);
                    ?>

                    <!--General-->
                    <div id="tab_general">
                        <dl>
                            <dt><?php echo __('category'); ?><span style="color: red">*</span>: </dt>
                            <dd>
                                <?php echo isset($cat_combo) ? $cat_combo : NULL; ?>
                            </dd>

                            <dt><?php echo __('name_of_ticket'); ?><span style="color: red">*</span>: </dt>
                            <dd>
                                <?php echo form_input(array('name' => 'ticket_name', 'value' => $ticket_name, 'max-length' => 300)); ?>
                            </dd>

                            <dt><?php echo __('price'); ?><span style="color: red">*</span>: </dt>
                            <dd>
                                <?php echo form_input(array('name' => 'price', 'value' => $price, 'max-length' => 300)); ?>
                            </dd>

                            <dt><?php echo __('quantity'); ?>: </dt>
                            <dd>
                                <?php echo form_input(array('name' => 'quantity', 'value' => $quantity, 'max-length' => 300)); ?>
                            </dd>

                            <dt><?php echo __('expiry'); ?>: </dt>
                            <dd>
                                <?php echo form_input(array('name' => 'expiry_date', 'id' => 'expiry_date', 'value' => $expiry_date, 'max-length' => 300)); ?>
                            </dd>

                            <dt><?php echo __('description'); ?>: </dt>
                            <dd>
                                <?php echo form_textarea(array('name' => 'description', 'value' => $description, 'max-length' => 300)); ?>
                            </dd>

                        </dl>
                        <div style="clear: both;">&nbsp;</div>
                    </div>
                    <!--/General--> 

                    <!--Image-->
                    <div id="tab_image">

                        <dl>
                            <dt>&nbsp;</dt>
                            <dd>
                                <?php if (isset($current_img)): ?>
                                    <img src="<?php echo base_url();?>uploads/images/<?php echo MODULE_NAME; ?>/thumbnail/<?php echo $current_img; ?>"/>
                                <?php else : ?>
                                    <img src="<?php echo base_url();?>assets/images/no_img.png"/>
                                <?php endif; ?>
                            </dd>
                        </dl>

                        <dl>
                            <dt><?php echo __('choose_an_image'); ?>: </dt>

                            <dd>
                                <input type="file" name="userfile" size="35" accept="image/*" class="image_chooser"/>
                            </dd>
                        </dl>
                        <div style="clear: both;">&nbsp;</div>
                    </div>
                    <!--/Image-->

                    <!--Advanced-->
                    <div id="tab_advanced">
                        <dl>
                            <dt><?php echo __('tags'); ?>: </dt>
                            <dd>
                                <?php echo form_textarea(array('name' => 'tags', 'value' => $tags, 'max-length' => 256)); ?>
                            </dd>
                        </dl>
                        <div style="clear: both;">&nbsp;</div>
                    </div>
                    <!--/Advanced-->
                    <?php
                    echo form_submit('btnSubmit', __('submit'));
                    echo '&nbsp;';
                    echo form_reset('btnSubmit', __('reset'));
                    echo form_close();
                    ?>
                    <div style="clear: both;">&nbsp;</div>
                </div>                

            </div>

        </div>

    </div>
</div>


<script>
    $(function(){
        $('#tabs').tabs({ selected: <?php echo isset($tab_index) ? $tab_index : 0; ?> });
        $("#expiry_date").datepicker({ changeYear: true, changeMonth: true, dateFormat: 'yy-mm-dd' });
    });
    
</script>

<?php $this->load->view('layout/footer'); ?>
